home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / Libraries / tcl7.4b3 / doc / glob.n < prev    next >
Encoding:
Text File  |  1994-12-17  |  2.5 KB  |  80 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" Copyright (c) 1994 Sun Microsystems, Inc.
  4. '\"
  5. '\" See the file "license.terms" for information on usage and redistribution
  6. '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  7. '\" 
  8. '\" @(#) glob.n 1.4 94/12/17 16:18:03
  9. '\" 
  10. .so man.macros
  11. .HS glob tcl 7.0
  12. .BS
  13. '\" Note:  do not modify the .SH NAME line immediately below!
  14. .SH NAME
  15. glob \- Return names of files that match patterns
  16. .SH SYNOPSIS
  17. \fBglob \fR?\fIswitches\fR? \fIpattern \fR?\fIpattern ...\fR?
  18. .BE
  19.  
  20. .SH DESCRIPTION
  21. .PP
  22. This command performs file name ``globbing'' in a fashion similar to
  23. the csh shell.  It returns a list of the files whose names match any
  24. of the \fIpattern\fR arguments.
  25. .LP
  26. If the initial arguments to \fBglob\fR start with \fB\-\fR then
  27. .VS
  28. they are treated as switches.  The following switches are
  29. currently supported:
  30. .TP 15
  31. \fB\-nocomplain\fR
  32. Allows an empty list to be returned without error;  without this
  33. switch an error is returned if the result list would be empty.
  34. .TP 15
  35. \fB\-\|\-\fR
  36. Marks the end of switches.  The argument following this one will
  37. be treated as a \fIpattern\fR even if it starts with a \fB\-.
  38. .VE
  39. .PP
  40. The \fIpattern\fR arguments may contain any of the following
  41. special characters:
  42. .TP 10
  43. \fB?\fR
  44. Matches any single character.
  45. .TP 10
  46. \fB*\fR
  47. Matches any sequence of zero or more characters.
  48. .TP 10
  49. \fB[\fIchars\fB]\fR
  50. Matches any single character in \fIchars\fR.  If \fIchars\fR
  51. contains a sequence of the form \fIa\fB\-\fIb\fR then any
  52. character between \fIa\fR and \fIb\fR (inclusive) will match.
  53. .TP 10
  54. \fB\e\fIx\fR
  55. Matches the character \fIx\fR.
  56. .TP 10
  57. \fB{\fIa\fB,\fIb\fB,\fI...\fR}
  58. Matches any of the strings \fIa\fR, \fIb\fR, etc.
  59. .LP
  60. As with csh, a  ``.'' at the beginning of a file's name or just
  61. after a ``/'' must be matched explicitly or with a {} construct.
  62. In addition, all ``/'' characters must be matched explicitly.
  63. .LP
  64. If the first character in a \fIpattern\fR is ``~'' then it refers
  65. to the home directory for the user whose name follows the ``~''.
  66. If the ``~'' is followed immediately by ``/'' then the value of
  67. the HOME environment variable is used.
  68. .LP
  69. The \fBglob\fR command differs from csh globbing in two ways.
  70. First, it does not sort its result list (use the \fBlsort\fR
  71. command if you want the list sorted).
  72. .VS
  73. Second, \fBglob\fR only returns the names of files that actually
  74. exist;  in csh no check for existence is made unless a pattern
  75. contains a ?, *, or [] construct.
  76. .VE
  77.  
  78. .SH KEYWORDS
  79. exist, file, glob, pattern
  80.